/*
 * @Author: luojianfeng
 * @Date: 2023-03-08 10:43:46
 * @LastEditTime: 2023-03-08 14:32:28
 * @LastEditors: luojianfeng
 * @Description:
 */
import { language as cLanguage } from 'monaco-editor/esm/vs/basic-languages/objective-c/objective-c.js'
import 'monaco-editor/esm/vs/basic-languages/cpp/cpp.contribution.js'
import { Monaco } from '../types'
export default function registerSnippets(monaco: Monaco) {
  monaco.languages.registerCompletionItemProvider('c', {
    provideCompletionItems() {
      const suggestions: any[] = []
      cLanguage.keywords.forEach((item: any) => {
        suggestions.push({
          label: item,
          kind: monaco.languages.CompletionItemKind.Keyword,
          insertText: item
        })
      })

      return {
        suggestions: suggestions
      }
    }
  })
}
